﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public interface IEventHandler<T>
    {
        Task Handle(T eventMessage);
    }

    public class DoSomethingEventHandler : IEventHandler<DoSomethingEvent>
    {
        public Task Handle(DoSomethingEvent eventMessage)
        {
            Console.WriteLine($"Order created: {eventMessage.OrderId} for {eventMessage.CustomerName} at {eventMessage.CreatedAt}");
            return Task.CompletedTask;
        }
    }
}
